﻿<%@ Page Language="C#" %>
<%@ import Namespace="System.Data.OleDb" %>
<%@ import Namespace="System.Data" %>
<%    OleDbConnection conn = null;
try
{
    Response.ContentType = "text/xml";
    conn = DBOp.DbConn;
    OleDbCommand comm = conn.CreateCommand();
    comm.CommandText = "select 城区名称,年平均能耗 from 城区电量统计 where (年平均能耗 <> 0 or 年平均能耗 is not null) and 城区名称 is not null order by 年平均能耗 desc";
    System.Data.DataTable dt1 = new System.Data.DataTable();
    OleDbDataAdapter oda = new OleDbDataAdapter(comm);
    oda.Fill(dt1);
     %><chart palette='2' caption='分城区年耗电量统计' subCaption="（单位：千瓦时）" shownames='1' showvalues='0' formatNumberScale='0' labelDisplay='ROTATE' slantLabels='1'  decimals='2' baseFontSize='12' baseFontFamily='宋体' overlapColumns="0">
    <categories>    <%    foreach (DataRow dr in dt1.Rows)    {
               %>
               <category label='<%=dr["城区名称"].ToString() %>' />               <%    }         %>
    </categories>
               <dataset seriesName='年耗电量' color='AFD8F8' showValues='0'>                    <%foreach (DataRow dr1 in dt1.Rows)                      {                          %>
                          <set value='<%=dr1["年平均能耗"].ToString() %>' />                                                    <%                             }                    %>
               </dataset>
         <styles>
         <definition>
            <style name='caption' type='font' font='宋体' size='16' color='000000' /> 
            <style name='label' type='font' font='宋体' size='12' Bold='1' color='000000' /> 
         </definition>
         <application>
            <apply toObject='DataLabels' styles='label' />
            <apply toObject='DataValues' styles='label' />
            <apply toObject='Caption' styles='caption' />
            <apply toObject='ToolTip' styles='label' />
            <apply toObject='Legend' styles='label' />
            <apply toObject='ToolTip' styles='label' />
            <apply toObject='ToolTip' styles='label' />
         </application>   
    </styles> 
</chart>

<% 
    }
catch (Exception ex) { 
    
}
    finally{
    if(conn != null)
    conn.Close();} %>